import {APP_LOGIN, MENU_COLLAPSE, MENU_UNCOLLAPSE, SET_OPEN_KEYS, SET_USER_INFO, TOGGLE_MENU} from 'redux/constant/app'
import {IUserInfo} from "../../interface/login";

const login=(payload:string)=>{
    return {
        type:APP_LOGIN,
        payload:payload
    }
}

const toggleSideMenu=()=>{
    return {
        type:TOGGLE_MENU
    }
}
const collapseMenu=()=>{
    return {
        type:MENU_COLLAPSE
    }
}

const unCollapseMenu=()=>{
    return {
        type:MENU_UNCOLLAPSE
    }
}

export const setUserInfo=(payload:IUserInfo)=>{
    return {
        type:SET_USER_INFO,
        payload
    }
}

export const setOpenKeys=(payload:string[])=>{
    return{
        type:SET_OPEN_KEYS,
        payload
    }
}

export {login,collapseMenu,unCollapseMenu,toggleSideMenu}
